﻿using System;

namespace X22.Consul.Extension
{
    /// <summary>
    /// Consul 注册发现相关参数
    /// </summary>
    public class ConsulOption
    {
        /// <summary>
        /// 服务 必填
        /// </summary>
        public Service Service { get; set; }
        /// <summary>
        /// 服务健康检查地址 默认：/health
        /// </summary>
        public string ServiceHealthCheck { get; set; } = "/health";

        /// <summary>
        /// Consul 地址 默认：http://localhost:8500/
        /// </summary>
        public string ConsulAddress { get; set; } = "http://localhost:8500/";
    }

    /// <summary>
    /// 服务
    /// </summary>
    public class Service
    {
        /// <summary>
        /// http
        /// </summary>
        public string ServiceHead { get; set; } = "http";
        /// <summary>
        /// 服务名称
        /// </summary>
        public string ServiceName { get; set; }

        /// <summary>
        /// 服务IP
        /// </summary>
        public string ServiceIP { get; set; }

        /// <summary>
        /// 服务端口
        /// </summary>
        public int ServicePort { get; set; }
    }

}
